<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Paint neg z-order descendants into the composited scrolling layer</title>
  <script src="../../resources/run-after-layout-and-paint.js"></script>
  <style>
    .scrollable {
      overflow: scroll;
    }

    .scrolled {
      position: relative;
      z-index: -1;
    }

    #container {
      position: absolute;
      top: 10px;
      left: 10px;
      width: 200px;
      height: 200px;
      border: 1px black solid;
    }
  </style>
  <script type="text/javascript" charset="utf-8">
    if (window.internals)
      internals.settings.setPreferCompositingToLCDTextEnabled(true);

    function endTest()
    {
      var textarea = document.getElementById('container');
      textarea.scrollTop = 40;
      if (window.testRunner)
        testRunner.notifyDone();
    }

    function doTest()
    {
      var textarea = document.getElementById('container');
      textarea.focus();
      textarea.selectionStart = textarea.selectionEnd = 0;
      runAfterLayoutAndPaint(endTest);
    }

    window.addEventListener('load', doTest, false);

    if (window.testRunner)
      testRunner.waitUntilDone();
  </script>
</head>
<body>
  <div class="scrollable" id="container">
    <div class="scrolled">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>
    <div class="scrolled">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>
    <div class="scrolled">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    </div>
  </div>
</body>
</html>

